// bmp085.h
//

#ifndef __BMP085_H__
#define __BMP085_H__


/*
 *	CHIP_TYPE CONSTANTS
 */

#define BMP085_CHIP_ID			0x55


/*
 *	BMP085 I2C Address
 */

#define BMP085_I2C_ADDR			0xEE




/* 
 *	
 *	register definitions 	
 *
 */

#define BMP085_PROM_START_ADDR		0xAA
#define BMP085_PROM_DATA_LEN		  22

#define BMP085_CHIP_ID_REG			0xD0
#define BMP085_VERSION_REG			0xD1

#define BMP085_CTRL_MEAS_REG		0xF4
#define BMP085_ADC_OUT_MSB_REG		0xF6
#define BMP085_ADC_OUT_LSB_REG		0xF7

#define BMP085_SOFT_RESET_REG		0xE0

#define BMP085_T_MEASURE			0x2E				// temperature measurent 
#define BMP085_P_MEASURE			0x34				// pressure measurement

#define BMP085_TEMP_CONVERSION_TIME    5				// TO be spec'd by GL or SB


#define BMP085_0SS						3


#define BMP085_DDR		DDRC
#define BMP085_PORT		PORTC
#define BMP085_PIN		PINC
#define BMP085_EOS		PC6
#define BMP085_XCLR		PC7



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//

int bmp085_init();

short bmp085_calc_temperature(unsigned long ut);
long bmp085_calc_pressure(unsigned long up);

unsigned short bmp085_measure_temperature();
unsigned long bmp085_measure_pressure();


#endif // __BMP085_H__
